import SplitScreenComp from "@/components/splitScreen/index.vue";

import Vue from "vue";
const SplitScreen = Vue.extend(SplitScreenComp);

let instances = [];
const ModalTable = (options) => {
  // console.log('options', options)
  options.videoThis.$store.dispatch(
    "app/setSplitScreenRouting",
    options.videoThis.$route.path
  );

  // 实列化
  const instance = new SplitScreen({
    // 重点：在这里将你传过来的参数匹配到modalTable.vue组件的data
    data: {
      ...options,
    },
  });

  instance.$mount(); // 挂载但是并未插入dom，是一个完整的Vue实例
  document.body.appendChild(instance.$el); // 将dom插入body
  instance.openSplitScreen = true; // 这里修改modalTable.vue数据中的visible,这样modalTable组件就显示出来
  instances.push(instance);
  return instance;
};
export default ModalTable;
